﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL = Auto.Data.BusMan.BLL;
using Model = Auto.Data.BusMan.Model;

namespace Auto.BusMan.AddForm
{
    public partial class fmCarMaintenanceAddForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitPage();
            }
        }

        private void InitPage()
        {
            string busid = Request.QueryString["DocID"];
            BindData(busid);
        }

        private void BindData(string docid)
        {
            BLL.BusMaintenance bl = new BLL.BusMaintenance();
            Model.BusMaintenance model = bl.GetModel(docid);

            this.lblCompanyName.Text =new Auto.Data.HumanResource.Division(model.RecDivID).ShortName;
            //this.lblBusID.Text = model.BusID;
            this.lblBusIdentificationNO.Text = model.BusIdentificationNO;
            //this.lblMaintenanceTypeID.Text = model.MaintenanceTypeID;
            this.lblMaintenanceTypeName.Text = model.MaintenanceTypeName;
            this.lblMaintenanceDate.Text = model.MaintenanceDate.ToString("yyyy-MM-dd");
            this.lblMaintenanceManufacturer.Text = model.MaintenanceManufacturerDesc+","+model.MaintenanceManufacturerOther;
            this.lblMaintenancePrincipal.Text = model.MaintenancePrincipal;
            this.lblMaintenanceMajorComponent.Text = model.MaintenanceMajorComponent;
            this.lblTotalCost.Text = model.TotalCost.ToString();
            this.ucMaintenanceOutListFileShow.FileList = model.MaintenanceOutList;// this.lblMaintenanceOutList.Text = model.MaintenanceOutList;
           

        }
    }
}